<?php
/**
 * Created by PhpStorm.
 * User: Silence
 * Date: 2017-07-14
 * Time: 22:27
 */

namespace App\Http\Controllers\Admin;

use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;

class MoneyController extends Controller
{
    public function searchMoney()
    {
        $data['areaData'] = DB::table('area')->get();
        $data['moneyData'] =DB::table('task')
            ->leftJoin('area','area_id','=','task_area')
            ->leftJoin('customer','customer_id','=','task_customer')
            ->get();
        $data['nowMoney'] =DB::table('task')
            ->leftJoin('area','area_id','=','task_area')
            ->leftJoin('customer','customer_id','=','task_customer')
            ->sum('task_money');
        return view("/admin.searchMoney",$data);
    }

    public function test()
    {
        return view("/admin.test");
    }
}